const isType = (type) => (v) =>
  Object.prototype.toString.call(v) == `[object ${type}]`;
let util = {};
[
  "Object",
  "String",
  "Number",
  "Boolean",
  "Null",
  "Undefined",
  "Symbol",
  "Array",
  "RegExp",
  "Date",
  "Function",
  "Window",
].forEach((x) => (util[`is${x}`] = isType(x)));

const log = console.log;
log(util.isObject({}));
log(util.isDate(new Date));
log(util.isString(''));
log(util.isNumber(1));
log(util.isBoolean(true));
log(util.isNull(null));
log(util.isUndefined(undefined));
log(util.isSymbol(Symbol('1')));
log(util.isArray([]));
log(util.isRegExp(/a/));
log(util.isFunction(()=>{}));
// log(util.isWindow(window));

